package org.eweb4j.solidbase.code.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.eweb4j.component.dwz.DWZ;
import org.eweb4j.component.dwz.DWZCons;
import org.eweb4j.ioc.IOC;
import org.eweb4j.mvc.validator.annotation.IntVal;
import org.eweb4j.mvc.validator.annotation.SizeVal;
import org.eweb4j.solidbase.code.model.CodeCons;
import org.eweb4j.solidbase.code.model.CodeService;

public abstract class CodeBaseAction {
	@IntVal
	protected long codeTypeId = -1;

	@IntVal
	protected long parentId = -1;

	@IntVal
	@SizeVal(min = -1)
	protected int pageNum = 1;
	@IntVal
	@SizeVal(min = -1)
	protected int numPerPage = 20;

	protected HttpServletRequest request;
	protected HttpSession session;
	protected CodeService service = IOC.getBean(CodeCons.IOC_SERVICE_BEAN_ID());
	protected DWZ dwz = IOC.getBean(DWZCons.IOC_DWZ_BEAN_ID());

	public HttpServletRequest getRequest() {
		return request;
	}

	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}

	public CodeService getService() {
		return service;
	}

	public void setService(CodeService service) {
		this.service = service;
	}

	public DWZ getDwz() {
		return dwz;
	}

	public void setDwz(DWZ dwz) {
		this.dwz = dwz;
	}

	public long getCodeTypeId() {

		return codeTypeId;
	}

	public void setCodeTypeId(long codeTypeId) {
		this.codeTypeId = codeTypeId;
	}

	public long getParentId() {
		return parentId;
	}

	public void setParentId(long parentId) {
		this.parentId = parentId;
	}

	public int getPageNum() {
		return pageNum;
	}

	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}

	public int getNumPerPage() {
		return numPerPage;
	}

	public void setNumPerPage(int numPerPage) {
		this.numPerPage = numPerPage;
	}

	public HttpSession getSession() {
		return session;
	}

	public void setSession(HttpSession session) {
		this.session = session;
	}

}
